<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pybindgen.typehandlers.base.CodeBlock</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pybindgen-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="pybindgen-module.html">Package&nbsp;pybindgen</a> ::
        <a href="pybindgen.typehandlers-module.html">Package&nbsp;typehandlers</a> ::
        <a href="pybindgen.typehandlers.base-module.html">Module&nbsp;base</a> ::
        Class&nbsp;CodeBlock
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pybindgen.typehandlers.base.CodeBlock-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class CodeBlock</h1><p class="nomargin-top"><span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#CodeBlock">source&nbsp;code</a></span></p>
<center>
<center>  <map id="uml_class_diagram_for_pybindge_71" name="uml_class_diagram_for_pybindge_71">
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock.CleanupHandle-class.html" title="Handle for some cleanup code" alt="" coords="17,28,399,47"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#__init__" title="CodeBlock constructor" alt="" coords="17,49,399,68"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#clear" title="pybindgen.typehandlers.base.CodeBlock.clear" alt="" coords="17,68,399,87"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#declare_variable" title="Calls declare_variable() on the associated DeclarationsScope object." alt="" coords="17,87,399,105"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_code" title="Write out some simple code" alt="" coords="17,105,399,124"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#indent" title="Add a certain ammount of indentation to all lines written from now on and &#160;until unindent() is called" alt="" coords="17,124,399,143"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#unindent" title="Revert indentation level to the value before last indent() call" alt="" coords="17,143,399,161"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#add_cleanup_code" title="Add a chunk of code used to cleanup previously allocated resources" alt="" coords="17,161,399,180"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#remove_cleanup_code" title="Remove cleanup code previously added with add_cleanup_code()" alt="" coords="17,180,399,199"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#get_cleanup_code" title="return a new list with all cleanup actions, including the ones from &#160;predecessor code blocks; Note: cleanup actions are executed in reverse &#160;order than when they were added." alt="" coords="17,199,399,217"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_error_check" title="Add a chunk of code that checks for a possible error" alt="" coords="17,217,399,236"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_cleanup" title="Write the current cleanup code." alt="" coords="17,236,399,255"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_error_return" title="Add a chunk of code that cleans up and returns an error." alt="" coords="17,255,399,273"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html" title="An intelligent code block that keeps track of cleanup actions." alt="" coords="16,11,400,275"/>
</map>
  <img src="uml_class_diagram_for_pybindge_71.gif" alt='' usemap="#uml_class_diagram_for_pybindge_71" ismap="ismap" class="graph-without-title" />
</center>
</center>
<hr />
<p>An intelligent code block that keeps track of cleanup actions. This 
  object is to be used by TypeHandlers when generating code.</p>

<!-- ==================== NESTED CLASSES ==================== -->
<a name="section-NestedClasses"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Nested Classes</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pybindgen.typehandlers.base.CodeBlock.CleanupHandle-class.html" class="summary-name">CleanupHandle</a><br />
      Handle for some cleanup code
    </td>
  </tr>
</table>
<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Instance Methods</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pybindgen.typehandlers.base.CodeBlock-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">error_return</span>,
        <span class="summary-sig-arg">declarations</span>,
        <span class="summary-sig-arg">predecessor</span>=<span class="summary-sig-default">None</span>)</span><br />
      CodeBlock constructor</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#CodeBlock.__init__">source&nbsp;code</a></span>
            <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for___init___54-summary-div');return false;">call&nbsp;graph</a></span>&nbsp;
          </td>
        </tr>
      </table>
      <div style="display:none" id="call_graph_for___init___54-summary-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for___init___54" name="call_graph_for___init___54">
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_generate_copy_method" title="cppclass.CppClass._generate_copy_method()" alt="" coords="7,5,433,37"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#__init__" title="__init__()" alt="" coords="484,117,588,149"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_generate_destructor" title="cppclass.CppClass._generate_destructor()" alt="" coords="20,61,420,93"/>
<area shape="rect" href="pybindgen.module.ModuleBase-class.html#__init__" title="module.ModuleBase.__init__()" alt="" coords="73,117,367,149"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.MemoryCodeSink-class.html#__init__" title="codesink.MemoryCodeSink.__init__()" alt="" coords="639,117,993,149"/>
<area shape="rect" href="pybindgen.typehandlers.base.ForwardWrapperBase-class.html#__init__" title="ForwardWrapperBase.__init__()" alt="" coords="65,173,375,205"/>
<area shape="rect" href="pybindgen.typehandlers.base.ReverseWrapperBase-class.html#__init__" title="ReverseWrapperBase.__init__()" alt="" coords="67,229,373,261"/>
</map>
  <img src="call_graph_for___init___54.gif" alt='' usemap="#call_graph_for___init___54" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="clear"></a><span class="summary-sig-name">clear</span>(<span class="summary-sig-arg">self</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#CodeBlock.clear">source&nbsp;code</a></span>
            <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for_clear_2-summary-div');return false;">call&nbsp;graph</a></span>&nbsp;
          </td>
        </tr>
      </table>
      <div style="display:none" id="call_graph_for_clear_2-summary-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for_clear_2" name="call_graph_for_clear_2">
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#clear" title="clear()" alt="" coords="560,33,640,65"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.MemoryCodeSink-class.html#__init__" title="codesink.MemoryCodeSink.__init__()" alt="" coords="689,33,1044,65"/>
<area shape="rect" href="pybindgen.typehandlers.base.ForwardWrapperBase-class.html#reset_code_generation_state" title="ForwardWrapperBase.reset_code_generation_state()" alt="" coords="5,5,512,37"/>
<area shape="rect" href="pybindgen.typehandlers.base.ReverseWrapperBase-class.html#reset_code_generation_state" title="ReverseWrapperBase.reset_code_generation_state()" alt="" coords="7,61,511,93"/>
</map>
  <img src="call_graph_for_clear_2.gif" alt='' usemap="#call_graph_for_clear_2" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="declare_variable"></a><span class="summary-sig-name">declare_variable</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">type_</span>,
        <span class="summary-sig-arg">name</span>,
        <span class="summary-sig-arg">initializer</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">array</span>=<span class="summary-sig-default">None</span>)</span><br />
      Calls declare_variable() on the associated DeclarationsScope object.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#CodeBlock.declare_variable">source&nbsp;code</a></span>
            <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for_declare_variabl-summary-div');return false;">call&nbsp;graph</a></span>&nbsp;
          </td>
        </tr>
      </table>
      <div style="display:none" id="call_graph_for_declare_variabl-summary-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for_declare_variabl" name="call_graph_for_declare_variabl">
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#declare_variable" title="declare_variable()" alt="" coords="717,33,901,65"/>
<area shape="rect" href="pybindgen.typehandlers.base.DeclarationsScope-class.html#declare_variable" title="DeclarationsScope.declare_variable()" alt="" coords="949,33,1309,65"/>
<area shape="rect" href="pybindgen.wrapper_registry.StdMapWrapperRegistry-class.html#write_lookup_wrapper" title="wrapper_registry.StdMapWrapperRegistry.write_lookup_wrapper()" alt="" coords="24,5,651,37"/>
<area shape="rect" href="pybindgen.wrapper_registry.StdMapWrapperRegistry-class.html#write_unregister_wrapper" title="wrapper_registry.StdMapWrapperRegistry.write_unregister_wrapper()" alt="" coords="5,61,669,93"/>
</map>
  <img src="call_graph_for_declare_variabl.gif" alt='' usemap="#call_graph_for_declare_variabl" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="write_code"></a><span class="summary-sig-name">write_code</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">code</span>)</span><br />
      Write out some simple code</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#CodeBlock.write_code">source&nbsp;code</a></span>
            <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for_write_code-summary-div');return false;">call&nbsp;graph</a></span>&nbsp;
          </td>
        </tr>
      </table>
      <div style="display:none" id="call_graph_for_write_code-summary-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for_write_code" name="call_graph_for_write_code">
<area shape="rect" href="pybindgen.container.Container-class.html#generate" title="container.Container.generate()" alt="" coords="199,28,503,60"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_code" title="write_code()" alt="" coords="744,1428,880,1460"/>
<area shape="rect" href="pybindgen.container.ContainerParameter-class.html#convert_c_to_python" title="container.ContainerParameter.convert_c_to_python()" alt="" coords="96,84,605,116"/>
<area shape="rect" href="pybindgen.container.ContainerPtrParameter-class.html#convert_python_to_c" title="container.ContainerPtrParameter.convert_python_to_c()" alt="" coords="81,140,620,172"/>
<area shape="rect" href="pybindgen.container.ContainerRefParameter-class.html#convert_c_to_python" title="container.ContainerRefParameter.convert_c_to_python()" alt="" coords="81,196,620,228"/>
<area shape="rect" href="pybindgen.container.ContainerRefParameter-class.html#convert_python_to_c" title="container.ContainerRefParameter.convert_python_to_c()" alt="" coords="81,252,620,284"/>
<area shape="rect" href="pybindgen.container.ContainerReturnValue-class.html#convert_c_to_python" title="container.ContainerReturnValue.convert_c_to_python()" alt="" coords="85,308,616,340"/>
<area shape="rect" href="pybindgen.container.IterNextWrapper-class.html#generate_call" title="container.IterNextWrapper.generate_call()" alt="" coords="147,364,555,396"/>
<area shape="rect" href="pybindgen.converter_functions.CToPythonConverter-class.html#generate" title="converter_functions.CToPythonConverter.generate()" alt="" coords="99,420,603,452"/>
<area shape="rect" href="pybindgen.converter_functions.PythonToCConverter-class.html#generate" title="converter_functions.PythonToCConverter.generate()" alt="" coords="99,476,603,508"/>
<area shape="rect" href="pybindgen.cppattribute.CppInstanceAttributeSetter-class.html#generate" title="cppattribute.CppInstanceAttributeSetter.generate()" alt="" coords="103,532,599,564"/>
<area shape="rect" href="pybindgen.cppattribute.CppStaticAttributeSetter-class.html#generate" title="cppattribute.CppStaticAttributeSetter.generate()" alt="" coords="115,588,587,620"/>
<area shape="rect" href="pybindgen.cppattribute.PyMetaclass-class.html#generate" title="cppattribute.PyMetaclass.generate()" alt="" coords="173,644,528,676"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_generate_copy_method" title="cppclass.CppClass._generate_copy_method()" alt="" coords="137,700,564,732"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_generate_destructor" title="cppclass.CppClass._generate_destructor()" alt="" coords="151,756,551,788"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_register_typeid" title="cppclass.CppClass._register_typeid()" alt="" coords="175,812,527,844"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#generate" title="cppclass.CppClass.generate()" alt="" coords="208,868,493,900"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#generate_typedef" title="cppclass.CppClass.generate_typedef()" alt="" coords="168,924,533,956"/>
<area shape="rect" href="pybindgen.cppclass.ReferenceCountingMethodsPolicy-class.html#write_decref" title="cppclass.ReferenceCountingMethodsPolicy.write_decref()" alt="" coords="81,980,620,1012"/>
<area shape="rect" href="pybindgen.cppclass.ReferenceCountingMethodsPolicy-class.html#write_incref" title="cppclass.ReferenceCountingMethodsPolicy.write_incref()" alt="" coords="84,1036,617,1068"/>
<area shape="rect" href="pybindgen.cppclass-module.html#default_instance_creation_function" title="cppclass.default_instance_creation_function()" alt="" coords="133,1092,568,1124"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassParameter-class.html#convert_c_to_python" title="cppclass_typehandlers.CppClassParameter.convert_c_to_python()" alt="" coords="41,1148,660,1180"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassParameter-class.html#convert_python_to_c" title="cppclass_typehandlers.CppClassParameter.convert_python_to_c()" alt="" coords="41,1204,660,1236"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassPtrParameter-class.html#convert_c_to_python" title="cppclass_typehandlers.CppClassPtrParameter.convert_c_to_python()" alt="" coords="27,1260,675,1292"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassPtrParameter-class.html#convert_python_to_c" title="cppclass_typehandlers.CppClassPtrParameter.convert_python_to_c()" alt="" coords="27,1316,675,1348"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassPtrReturnValue-class.html#convert_c_to_python" title="cppclass_typehandlers.CppClassPtrReturnValue.convert_c_to_python()" alt="" coords="17,1372,684,1404"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassRefParameter-class.html#convert_c_to_python" title="cppclass_typehandlers.CppClassRefParameter.convert_c_to_python()" alt="" coords="27,1428,675,1460"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassRefParameter-class.html#convert_python_to_c" title="cppclass_typehandlers.CppClassRefParameter.convert_python_to_c()" alt="" coords="27,1484,675,1516"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassReturnValue-class.html#convert_c_to_python" title="cppclass_typehandlers.CppClassReturnValue.convert_c_to_python()" alt="" coords="31,1540,671,1572"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassReturnValue-class.html#convert_python_to_c" title="cppclass_typehandlers.CppClassReturnValue.convert_python_to_c()" alt="" coords="31,1596,671,1628"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers-module.html#_add_ward" title="cppclass_typehandlers._add_ward()" alt="" coords="179,1652,523,1684"/>
<area shape="rect" href="pybindgen.cppmethod.CppConstructor-class.html#generate_call" title="cppmethod.CppConstructor.generate_call()" alt="" coords="144,1708,557,1740"/>
<area shape="rect" href="pybindgen.cppmethod.CppFunctionAsConstructor-class.html#generate_call" title="cppmethod.CppFunctionAsConstructor.generate_call()" alt="" coords="93,1764,608,1796"/>
<area shape="rect" href="pybindgen.cppmethod.CppMethod-class.html#generate_call" title="cppmethod.CppMethod.generate_call()" alt="" coords="163,1820,539,1852"/>
<area shape="rect" href="pybindgen.cppmethod.CppVirtualMethodParentCaller-class.html#generate_call" title="cppmethod.CppVirtualMethodParentCaller.generate_call()" alt="" coords="76,1876,625,1908"/>
<area shape="rect" href="pybindgen.cppmethod.CppVirtualMethodProxy-class.html#generate" title="cppmethod.CppVirtualMethodProxy.generate()" alt="" coords="128,1932,573,1964"/>
<area shape="rect" href="pybindgen.cppmethod.CppVirtualMethodProxy-class.html#generate_python_call" title="cppmethod.CppVirtualMethodProxy.generate_python_call()" alt="" coords="71,1988,631,2020"/>
<area shape="rect" href="pybindgen.enum.Enum-class.html#generate" title="enum.Enum.generate()" alt="" coords="233,2044,468,2076"/>
<area shape="rect" href="pybindgen.function.Function-class.html#generate_call" title="function.Function.generate_call()" alt="" coords="189,2100,512,2132"/>
<area shape="rect" href="pybindgen.module.ModuleBase-class.html#do_generate" title="module.ModuleBase.do_generate()" alt="" coords="181,2156,520,2188"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.MemoryCodeSink-class.html#writeln" title="codesink.MemoryCodeSink.writeln()" alt="" coords="928,1428,1280,1460"/>
<area shape="rect" href="pybindgen.typehandlers.base.ForwardWrapperBase-class.html#generate_body" title="ForwardWrapperBase.generate_body()" alt="" coords="163,2212,539,2244"/>
<area shape="rect" href="pybindgen.typehandlers.base.ReverseWrapperBase-class.html#_generate_gil_code" title="ReverseWrapperBase._generate_gil_code()" alt="" coords="144,2268,557,2300"/>
<area shape="rect" href="pybindgen.typehandlers.base.ReverseWrapperBase-class.html#generate" title="ReverseWrapperBase.generate()" alt="" coords="191,2324,511,2356"/>
<area shape="rect" href="pybindgen.typehandlers.floattype.FloatPtrParam-class.html#convert_python_to_c" title="floattype.FloatPtrParam.convert_python_to_c()" alt="" coords="123,2380,579,2412"/>
<area shape="rect" href="pybindgen.typehandlers.inttype.UInt16Return-class.html#convert_python_to_c" title="inttype.UInt16Return.convert_python_to_c()" alt="" coords="135,2436,567,2468"/>
<area shape="rect" href="pybindgen.typehandlers.inttype.UInt8Return-class.html#convert_python_to_c" title="inttype.UInt8Return.convert_python_to_c()" alt="" coords="140,2492,561,2524"/>
<area shape="rect" href="pybindgen.typehandlers.pyobjecttype.PyObjectReturnValue-class.html#convert_python_to_c" title="pyobjecttype.PyObjectReturnValue.convert_python_to_c()" alt="" coords="73,2548,628,2580"/>
<area shape="rect" href="pybindgen.typehandlers.stringtype.StdStringRefParam-class.html#convert_python_to_c" title="stringtype.StdStringRefParam.convert_python_to_c()" alt="" coords="97,2604,604,2636"/>
<area shape="rect" href="pybindgen.typehandlers.stringtype.StdStringReturn-class.html#convert_python_to_c" title="stringtype.StdStringReturn.convert_python_to_c()" alt="" coords="109,2660,592,2692"/>
<area shape="rect" href="pybindgen.wrapper_registry.StdMapWrapperRegistry-class.html#write_lookup_wrapper" title="wrapper_registry.StdMapWrapperRegistry.write_lookup_wrapper()" alt="" coords="37,2716,664,2748"/>
<area shape="rect" href="pybindgen.wrapper_registry.StdMapWrapperRegistry-class.html#write_register_new_wrapper" title="wrapper_registry.StdMapWrapperRegistry.write_register_new_wrapper()" alt="" coords="7,2772,695,2804"/>
<area shape="rect" href="pybindgen.wrapper_registry.StdMapWrapperRegistry-class.html#write_unregister_wrapper" title="wrapper_registry.StdMapWrapperRegistry.write_unregister_wrapper()" alt="" coords="19,2828,683,2860"/>
</map>
  <img src="call_graph_for_write_code.gif" alt='' usemap="#call_graph_for_write_code" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="indent"></a><span class="summary-sig-name">indent</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">level</span>=<span class="summary-sig-default">4</span>)</span><br />
      Add a certain ammount of indentation to all lines written from now on
      and until unindent() is called</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#CodeBlock.indent">source&nbsp;code</a></span>
            <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for_indent-summary-div');return false;">call&nbsp;graph</a></span>&nbsp;
          </td>
        </tr>
      </table>
      <div style="display:none" id="call_graph_for_indent-summary-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for_indent" name="call_graph_for_indent">
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassParameter-class.html#convert_python_to_c" title="cppclass_typehandlers.CppClassParameter.convert_python_to_c()" alt="" coords="31,12,649,44"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#indent" title="indent()" alt="" coords="724,264,817,296"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassPtrParameter-class.html#convert_c_to_python" title="cppclass_typehandlers.CppClassPtrParameter.convert_c_to_python()" alt="" coords="16,68,664,100"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassPtrParameter-class.html#convert_python_to_c" title="cppclass_typehandlers.CppClassPtrParameter.convert_python_to_c()" alt="" coords="16,124,664,156"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassPtrReturnValue-class.html#convert_c_to_python" title="cppclass_typehandlers.CppClassPtrReturnValue.convert_c_to_python()" alt="" coords="7,180,673,212"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassRefParameter-class.html#convert_c_to_python" title="cppclass_typehandlers.CppClassRefParameter.convert_c_to_python()" alt="" coords="16,236,664,268"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassRefParameter-class.html#convert_python_to_c" title="cppclass_typehandlers.CppClassRefParameter.convert_python_to_c()" alt="" coords="16,292,664,324"/>
<area shape="rect" href="pybindgen.cppmethod.CppConstructor-class.html#generate_call" title="cppmethod.CppConstructor.generate_call()" alt="" coords="133,348,547,380"/>
<area shape="rect" href="pybindgen.cppmethod.CppVirtualMethodProxy-class.html#generate" title="cppmethod.CppVirtualMethodProxy.generate()" alt="" coords="117,404,563,436"/>
<area shape="rect" href="pybindgen.enum.Enum-class.html#generate" title="enum.Enum.generate()" alt="" coords="223,460,457,492"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.CodeSink-class.html#indent" title="codesink.CodeSink.indent()" alt="" coords="867,264,1139,296"/>
<area shape="rect" href="pybindgen.typehandlers.floattype.FloatPtrParam-class.html#convert_python_to_c" title="floattype.FloatPtrParam.convert_python_to_c()" alt="" coords="112,516,568,548"/>
</map>
  <img src="call_graph_for_indent.gif" alt='' usemap="#call_graph_for_indent" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="unindent"></a><span class="summary-sig-name">unindent</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Revert indentation level to the value before last indent() call</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#CodeBlock.unindent">source&nbsp;code</a></span>
            <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for_unindent-summary-div');return false;">call&nbsp;graph</a></span>&nbsp;
          </td>
        </tr>
      </table>
      <div style="display:none" id="call_graph_for_unindent-summary-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for_unindent" name="call_graph_for_unindent">
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassParameter-class.html#convert_python_to_c" title="cppclass_typehandlers.CppClassParameter.convert_python_to_c()" alt="" coords="31,9,649,41"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#unindent" title="unindent()" alt="" coords="724,261,841,293"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassPtrParameter-class.html#convert_c_to_python" title="cppclass_typehandlers.CppClassPtrParameter.convert_c_to_python()" alt="" coords="16,65,664,97"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassPtrParameter-class.html#convert_python_to_c" title="cppclass_typehandlers.CppClassPtrParameter.convert_python_to_c()" alt="" coords="16,121,664,153"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassPtrReturnValue-class.html#convert_c_to_python" title="cppclass_typehandlers.CppClassPtrReturnValue.convert_c_to_python()" alt="" coords="7,177,673,209"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassRefParameter-class.html#convert_c_to_python" title="cppclass_typehandlers.CppClassRefParameter.convert_c_to_python()" alt="" coords="16,233,664,265"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassRefParameter-class.html#convert_python_to_c" title="cppclass_typehandlers.CppClassRefParameter.convert_python_to_c()" alt="" coords="16,289,664,321"/>
<area shape="rect" href="pybindgen.cppmethod.CppConstructor-class.html#generate_call" title="cppmethod.CppConstructor.generate_call()" alt="" coords="133,345,547,377"/>
<area shape="rect" href="pybindgen.cppmethod.CppVirtualMethodProxy-class.html#generate" title="cppmethod.CppVirtualMethodProxy.generate()" alt="" coords="117,401,563,433"/>
<area shape="rect" href="pybindgen.enum.Enum-class.html#generate" title="enum.Enum.generate()" alt="" coords="223,457,457,489"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.CodeSink-class.html#unindent" title="codesink.CodeSink.unindent()" alt="" coords="891,261,1187,293"/>
<area shape="rect" href="pybindgen.typehandlers.floattype.FloatPtrParam-class.html#convert_python_to_c" title="floattype.FloatPtrParam.convert_python_to_c()" alt="" coords="112,513,568,545"/>
</map>
  <img src="call_graph_for_unindent.gif" alt='' usemap="#call_graph_for_unindent" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pybindgen.typehandlers.base.CodeBlock-class.html#add_cleanup_code" class="summary-sig-name">add_cleanup_code</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">cleanup_code</span>)</span><br />
      Add a chunk of code used to cleanup previously allocated resources</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#CodeBlock.add_cleanup_code">source&nbsp;code</a></span>
            <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for_add_cleanup_cod-summary-div');return false;">call&nbsp;graph</a></span>&nbsp;
          </td>
        </tr>
      </table>
      <div style="display:none" id="call_graph_for_add_cleanup_cod-summary-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for_add_cleanup_cod" name="call_graph_for_add_cleanup_cod">
<area shape="rect" href="pybindgen.converter_functions.PythonToCConverter-class.html#generate" title="converter_functions.PythonToCConverter.generate()" alt="" coords="79,5,583,37"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#add_cleanup_code" title="add_cleanup_code()" alt="" coords="705,201,905,233"/>
<area shape="rect" href="pybindgen.cppattribute.CppInstanceAttributeSetter-class.html#generate" title="cppattribute.CppInstanceAttributeSetter.generate()" alt="" coords="83,61,579,93"/>
<area shape="rect" href="pybindgen.cppattribute.CppStaticAttributeSetter-class.html#generate" title="cppattribute.CppStaticAttributeSetter.generate()" alt="" coords="95,117,567,149"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassRefParameter-class.html#convert_c_to_python" title="cppclass_typehandlers.CppClassRefParameter.convert_c_to_python()" alt="" coords="7,173,655,205"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers-module.html#_add_ward" title="cppclass_typehandlers._add_ward()" alt="" coords="159,229,503,261"/>
<area shape="rect" href="pybindgen.cppmethod.CppVirtualMethodProxy-class.html#generate" title="cppmethod.CppVirtualMethodProxy.generate()" alt="" coords="108,285,553,317"/>
<area shape="rect" href="pybindgen.cppmethod.CppVirtualMethodProxy-class.html#generate_python_call" title="cppmethod.CppVirtualMethodProxy.generate_python_call()" alt="" coords="51,341,611,373"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock.CleanupHandle-class.html#__init__" title="CleanupHandle.__init__()" alt="" coords="976,173,1227,205"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock.CleanupHandle-class.html#get_position" title="CleanupHandle.get_position()" alt="" coords="956,229,1247,261"/>
<area shape="rect" href="pybindgen.typehandlers.base.ReverseWrapperBase-class.html#_generate_gil_code" title="ReverseWrapperBase._generate_gil_code()" alt="" coords="124,397,537,429"/>
</map>
  <img src="call_graph_for_add_cleanup_cod.gif" alt='' usemap="#call_graph_for_add_cleanup_cod" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="remove_cleanup_code"></a><span class="summary-sig-name">remove_cleanup_code</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">handle</span>)</span><br />
      Remove cleanup code previously added with add_cleanup_code()</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#CodeBlock.remove_cleanup_code">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="get_cleanup_code"></a><span class="summary-sig-name">get_cleanup_code</span>(<span class="summary-sig-arg">self</span>)</span><br />
      return a new list with all cleanup actions, including the ones from 
      predecessor code blocks; Note: cleanup actions are executed in 
      reverse order than when they were added.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#CodeBlock.get_cleanup_code">source&nbsp;code</a></span>
            <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for_get_cleanup_cod-summary-div');return false;">call&nbsp;graph</a></span>&nbsp;
          </td>
        </tr>
      </table>
      <div style="display:none" id="call_graph_for_get_cleanup_cod-summary-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for_get_cleanup_cod" name="call_graph_for_get_cleanup_cod">
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#get_cleanup_code" title="get_cleanup_code()" alt="" coords="220,29,417,61"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_cleanup" title="write_cleanup()" alt="" coords="5,29,171,61"/>
</map>
  <img src="call_graph_for_get_cleanup_cod.gif" alt='' usemap="#call_graph_for_get_cleanup_cod" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pybindgen.typehandlers.base.CodeBlock-class.html#write_error_check" class="summary-sig-name">write_error_check</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">failure_expression</span>,
        <span class="summary-sig-arg">failure_cleanup</span>=<span class="summary-sig-default">None</span>)</span><br />
      Add a chunk of code that checks for a possible error</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#CodeBlock.write_error_check">source&nbsp;code</a></span>
            <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for_write_error_che-summary-div');return false;">call&nbsp;graph</a></span>&nbsp;
          </td>
        </tr>
      </table>
      <div style="display:none" id="call_graph_for_write_error_che-summary-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for_write_error_che" name="call_graph_for_write_error_che">
<area shape="rect" href="pybindgen.container.Container-class.html#generate" title="container.Container.generate()" alt="" coords="177,8,481,40"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_error_check" title="write_error_check()" alt="" coords="701,372,904,404"/>
<area shape="rect" href="pybindgen.container.IterNextWrapper-class.html#generate_call" title="container.IterNextWrapper.generate_call()" alt="" coords="125,64,533,96"/>
<area shape="rect" href="pybindgen.converter_functions.PythonToCConverter-class.html#generate" title="converter_functions.PythonToCConverter.generate()" alt="" coords="77,120,581,152"/>
<area shape="rect" href="pybindgen.cppattribute.CppInstanceAttributeSetter-class.html#generate" title="cppattribute.CppInstanceAttributeSetter.generate()" alt="" coords="81,176,577,208"/>
<area shape="rect" href="pybindgen.cppattribute.CppStaticAttributeSetter-class.html#generate" title="cppattribute.CppStaticAttributeSetter.generate()" alt="" coords="93,232,565,264"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#generate" title="cppclass.CppClass.generate()" alt="" coords="187,288,472,320"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassPtrParameter-class.html#convert_python_to_c" title="cppclass_typehandlers.CppClassPtrParameter.convert_python_to_c()" alt="" coords="5,344,653,376"/>
<area shape="rect" href="pybindgen.cppmethod.CppVirtualMethodProxy-class.html#generate_python_call" title="cppmethod.CppVirtualMethodProxy.generate_python_call()" alt="" coords="49,400,609,432"/>
<area shape="rect" href="pybindgen.module.ModuleBase-class.html#do_generate" title="module.ModuleBase.do_generate()" alt="" coords="160,456,499,488"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_error_return" title="write_error_return()" alt="" coords="1024,288,1232,320"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.CodeSink-class.html#indent" title="codesink.CodeSink.indent()" alt="" coords="992,344,1264,376"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.CodeSink-class.html#unindent" title="codesink.CodeSink.unindent()" alt="" coords="980,400,1276,432"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.MemoryCodeSink-class.html#writeln" title="codesink.MemoryCodeSink.writeln()" alt="" coords="952,456,1304,488"/>
<area shape="rect" href="pybindgen.typehandlers.base.ForwardWrapperBase-class.html#generate_body" title="ForwardWrapperBase.generate_body()" alt="" coords="141,512,517,544"/>
<area shape="rect" href="pybindgen.typehandlers.base.ReverseWrapperBase-class.html#generate" title="ReverseWrapperBase.generate()" alt="" coords="169,568,489,600"/>
<area shape="rect" href="pybindgen.typehandlers.floattype.FloatPtrParam-class.html#convert_python_to_c" title="floattype.FloatPtrParam.convert_python_to_c()" alt="" coords="101,624,557,656"/>
<area shape="rect" href="pybindgen.typehandlers.inttype.UInt16Return-class.html#convert_python_to_c" title="inttype.UInt16Return.convert_python_to_c()" alt="" coords="113,680,545,712"/>
<area shape="rect" href="pybindgen.typehandlers.inttype.UInt8Return-class.html#convert_python_to_c" title="inttype.UInt8Return.convert_python_to_c()" alt="" coords="119,736,540,768"/>
</map>
  <img src="call_graph_for_write_error_che.gif" alt='' usemap="#call_graph_for_write_error_che" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="write_cleanup"></a><span class="summary-sig-name">write_cleanup</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Write the current cleanup code.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#CodeBlock.write_cleanup">source&nbsp;code</a></span>
            <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for_write_cleanup-summary-div');return false;">call&nbsp;graph</a></span>&nbsp;
          </td>
        </tr>
      </table>
      <div style="display:none" id="call_graph_for_write_cleanup-summary-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for_write_cleanup" name="call_graph_for_write_cleanup">
<area shape="rect" href="pybindgen.converter_functions.CToPythonConverter-class.html#generate" title="converter_functions.CToPythonConverter.generate()" alt="" coords="5,5,509,37"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_cleanup" title="write_cleanup()" alt="" coords="557,285,723,317"/>
<area shape="rect" href="pybindgen.converter_functions.PythonToCConverter-class.html#generate" title="converter_functions.PythonToCConverter.generate()" alt="" coords="5,61,509,93"/>
<area shape="rect" href="pybindgen.cppattribute.CppInstanceAttributeSetter-class.html#generate" title="cppattribute.CppInstanceAttributeSetter.generate()" alt="" coords="9,117,505,149"/>
<area shape="rect" href="pybindgen.cppattribute.CppStaticAttributeSetter-class.html#generate" title="cppattribute.CppStaticAttributeSetter.generate()" alt="" coords="21,173,493,205"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_generate_copy_method" title="cppclass.CppClass._generate_copy_method()" alt="" coords="44,229,471,261"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_generate_destructor" title="cppclass.CppClass._generate_destructor()" alt="" coords="57,285,457,317"/>
<area shape="rect" href="pybindgen.cppmethod.CppVirtualMethodProxy-class.html#generate" title="cppmethod.CppVirtualMethodProxy.generate()" alt="" coords="35,341,480,373"/>
<area shape="rect" href="pybindgen.module.ModuleBase-class.html#do_generate" title="module.ModuleBase.do_generate()" alt="" coords="88,397,427,429"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#get_cleanup_code" title="get_cleanup_code()" alt="" coords="848,257,1045,289"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.MemoryCodeSink-class.html#writeln" title="codesink.MemoryCodeSink.writeln()" alt="" coords="771,313,1123,345"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_error_return" title="write_error_return()" alt="" coords="153,453,361,485"/>
<area shape="rect" href="pybindgen.typehandlers.base.ForwardWrapperBase-class.html#generate_body" title="ForwardWrapperBase.generate_body()" alt="" coords="69,509,445,541"/>
<area shape="rect" href="pybindgen.typehandlers.base.ReverseWrapperBase-class.html#generate" title="ReverseWrapperBase.generate()" alt="" coords="97,565,417,597"/>
</map>
  <img src="call_graph_for_write_cleanup.gif" alt='' usemap="#call_graph_for_write_cleanup" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="write_error_return"></a><span class="summary-sig-name">write_error_return</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Add a chunk of code that cleans up and returns an error.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#CodeBlock.write_error_return">source&nbsp;code</a></span>
            <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for_write_error_ret-summary-div');return false;">call&nbsp;graph</a></span>&nbsp;
          </td>
        </tr>
      </table>
      <div style="display:none" id="call_graph_for_write_error_ret-summary-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for_write_error_ret" name="call_graph_for_write_error_ret">
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassParameter-class.html#convert_python_to_c" title="cppclass_typehandlers.CppClassParameter.convert_python_to_c()" alt="" coords="21,5,640,37"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_error_return" title="write_error_return()" alt="" coords="705,61,913,93"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassRefParameter-class.html#convert_python_to_c" title="cppclass_typehandlers.CppClassRefParameter.convert_python_to_c()" alt="" coords="7,61,655,93"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_cleanup" title="write_cleanup()" alt="" coords="1056,33,1221,65"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_error_check" title="write_error_check()" alt="" coords="229,117,432,149"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.MemoryCodeSink-class.html#writeln" title="codesink.MemoryCodeSink.writeln()" alt="" coords="963,89,1315,121"/>
</map>
  <img src="call_graph_for_write_error_ret.gif" alt='' usemap="#call_graph_for_write_error_ret" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__repr__</code>,
      <code>__setattr__</code>,
      <code>__sizeof__</code>,
      <code>__str__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Properties</span></td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Method Details</span></td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">error_return</span>,
        <span class="sig-arg">declarations</span>,
        <span class="sig-arg">predecessor</span>=<span class="sig-default">None</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#CodeBlock.__init__">source&nbsp;code</a></span>&nbsp;
    <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for___init___54-div');return false;">call&nbsp;graph</a></span>&nbsp;</td>
  </tr></table>
  <div style="display:none" id="call_graph_for___init___54-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for___init___54" name="call_graph_for___init___54">
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_generate_copy_method" title="cppclass.CppClass._generate_copy_method()" alt="" coords="7,5,433,37"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#__init__" title="__init__()" alt="" coords="484,117,588,149"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_generate_destructor" title="cppclass.CppClass._generate_destructor()" alt="" coords="20,61,420,93"/>
<area shape="rect" href="pybindgen.module.ModuleBase-class.html#__init__" title="module.ModuleBase.__init__()" alt="" coords="73,117,367,149"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.MemoryCodeSink-class.html#__init__" title="codesink.MemoryCodeSink.__init__()" alt="" coords="639,117,993,149"/>
<area shape="rect" href="pybindgen.typehandlers.base.ForwardWrapperBase-class.html#__init__" title="ForwardWrapperBase.__init__()" alt="" coords="65,173,375,205"/>
<area shape="rect" href="pybindgen.typehandlers.base.ReverseWrapperBase-class.html#__init__" title="ReverseWrapperBase.__init__()" alt="" coords="67,229,373,261"/>
</map>
  <img src="call_graph_for___init___54.gif" alt='' usemap="#call_graph_for___init___54" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

  <p>CodeBlock constructor</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>block = CodeBlock(<span class="py-string">&quot;return NULL;&quot;</span>, DeclarationsScope())
<span class="py-prompt">&gt;&gt;&gt; </span>block.write_code(<span class="py-string">&quot;foo();&quot;</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>cleanup1 = block.add_cleanup_code(<span class="py-string">&quot;clean1();&quot;</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>cleanup2 = block.add_cleanup_code(<span class="py-string">&quot;clean2();&quot;</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>cleanup3 = block.add_cleanup_code(<span class="py-string">&quot;clean3();&quot;</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>cleanup2.cancel()
<span class="py-prompt">&gt;&gt;&gt; </span>block.write_error_check(<span class="py-string">&quot;error()&quot;</span>, <span class="py-string">&quot;error_clean()&quot;</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>block.write_code(<span class="py-string">&quot;bar();&quot;</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>block.write_cleanup()
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> block.sink.flush().rstrip()
<span class="py-output">foo();</span>
<span class="py-output">if (error()) {</span>
<span class="py-output">    error_clean()</span>
<span class="py-output">    clean3();</span>
<span class="py-output">    clean1();</span>
<span class="py-output">    return NULL;</span>
<span class="py-output">}</span>
<span class="py-output">bar();</span>
<span class="py-output">clean3();</span>
<span class="py-output">clean1();</span></pre>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>error_return</code></strong> - code that is generated on error conditions (detected by 
          write_error_check()); normally it returns from the wrapper 
          function, e.g. return NULL;</li>
        <li><strong class="pname"><code>predecessor</code></strong> - optional predecessor code block; a predecessor is used to search 
          for additional cleanup actions.</li>
    </ul></dd>
    <dt>Overrides:
        object.__init__
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="add_cleanup_code"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">add_cleanup_code</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">cleanup_code</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#CodeBlock.add_cleanup_code">source&nbsp;code</a></span>&nbsp;
    <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for_add_cleanup_cod-div');return false;">call&nbsp;graph</a></span>&nbsp;</td>
  </tr></table>
  <div style="display:none" id="call_graph_for_add_cleanup_cod-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for_add_cleanup_cod" name="call_graph_for_add_cleanup_cod">
<area shape="rect" href="pybindgen.converter_functions.PythonToCConverter-class.html#generate" title="converter_functions.PythonToCConverter.generate()" alt="" coords="79,5,583,37"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#add_cleanup_code" title="add_cleanup_code()" alt="" coords="705,201,905,233"/>
<area shape="rect" href="pybindgen.cppattribute.CppInstanceAttributeSetter-class.html#generate" title="cppattribute.CppInstanceAttributeSetter.generate()" alt="" coords="83,61,579,93"/>
<area shape="rect" href="pybindgen.cppattribute.CppStaticAttributeSetter-class.html#generate" title="cppattribute.CppStaticAttributeSetter.generate()" alt="" coords="95,117,567,149"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassRefParameter-class.html#convert_c_to_python" title="cppclass_typehandlers.CppClassRefParameter.convert_c_to_python()" alt="" coords="7,173,655,205"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers-module.html#_add_ward" title="cppclass_typehandlers._add_ward()" alt="" coords="159,229,503,261"/>
<area shape="rect" href="pybindgen.cppmethod.CppVirtualMethodProxy-class.html#generate" title="cppmethod.CppVirtualMethodProxy.generate()" alt="" coords="108,285,553,317"/>
<area shape="rect" href="pybindgen.cppmethod.CppVirtualMethodProxy-class.html#generate_python_call" title="cppmethod.CppVirtualMethodProxy.generate_python_call()" alt="" coords="51,341,611,373"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock.CleanupHandle-class.html#__init__" title="CleanupHandle.__init__()" alt="" coords="976,173,1227,205"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock.CleanupHandle-class.html#get_position" title="CleanupHandle.get_position()" alt="" coords="956,229,1247,261"/>
<area shape="rect" href="pybindgen.typehandlers.base.ReverseWrapperBase-class.html#_generate_gil_code" title="ReverseWrapperBase._generate_gil_code()" alt="" coords="124,397,537,429"/>
</map>
  <img src="call_graph_for_add_cleanup_cod.gif" alt='' usemap="#call_graph_for_add_cleanup_cod" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

  <p>Add a chunk of code used to cleanup previously allocated resources</p>
  <p>Returns a handle used to cancel the cleanup code</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="write_error_check"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">write_error_check</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">failure_expression</span>,
        <span class="sig-arg">failure_cleanup</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#CodeBlock.write_error_check">source&nbsp;code</a></span>&nbsp;
    <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for_write_error_che-div');return false;">call&nbsp;graph</a></span>&nbsp;</td>
  </tr></table>
  <div style="display:none" id="call_graph_for_write_error_che-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for_write_error_che" name="call_graph_for_write_error_che">
<area shape="rect" href="pybindgen.container.Container-class.html#generate" title="container.Container.generate()" alt="" coords="177,8,481,40"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_error_check" title="write_error_check()" alt="" coords="701,372,904,404"/>
<area shape="rect" href="pybindgen.container.IterNextWrapper-class.html#generate_call" title="container.IterNextWrapper.generate_call()" alt="" coords="125,64,533,96"/>
<area shape="rect" href="pybindgen.converter_functions.PythonToCConverter-class.html#generate" title="converter_functions.PythonToCConverter.generate()" alt="" coords="77,120,581,152"/>
<area shape="rect" href="pybindgen.cppattribute.CppInstanceAttributeSetter-class.html#generate" title="cppattribute.CppInstanceAttributeSetter.generate()" alt="" coords="81,176,577,208"/>
<area shape="rect" href="pybindgen.cppattribute.CppStaticAttributeSetter-class.html#generate" title="cppattribute.CppStaticAttributeSetter.generate()" alt="" coords="93,232,565,264"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#generate" title="cppclass.CppClass.generate()" alt="" coords="187,288,472,320"/>
<area shape="rect" href="pybindgen.cppclass_typehandlers.CppClassPtrParameter-class.html#convert_python_to_c" title="cppclass_typehandlers.CppClassPtrParameter.convert_python_to_c()" alt="" coords="5,344,653,376"/>
<area shape="rect" href="pybindgen.cppmethod.CppVirtualMethodProxy-class.html#generate_python_call" title="cppmethod.CppVirtualMethodProxy.generate_python_call()" alt="" coords="49,400,609,432"/>
<area shape="rect" href="pybindgen.module.ModuleBase-class.html#do_generate" title="module.ModuleBase.do_generate()" alt="" coords="160,456,499,488"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_error_return" title="write_error_return()" alt="" coords="1024,288,1232,320"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.CodeSink-class.html#indent" title="codesink.CodeSink.indent()" alt="" coords="992,344,1264,376"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.CodeSink-class.html#unindent" title="codesink.CodeSink.unindent()" alt="" coords="980,400,1276,432"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.MemoryCodeSink-class.html#writeln" title="codesink.MemoryCodeSink.writeln()" alt="" coords="952,456,1304,488"/>
<area shape="rect" href="pybindgen.typehandlers.base.ForwardWrapperBase-class.html#generate_body" title="ForwardWrapperBase.generate_body()" alt="" coords="141,512,517,544"/>
<area shape="rect" href="pybindgen.typehandlers.base.ReverseWrapperBase-class.html#generate" title="ReverseWrapperBase.generate()" alt="" coords="169,568,489,600"/>
<area shape="rect" href="pybindgen.typehandlers.floattype.FloatPtrParam-class.html#convert_python_to_c" title="floattype.FloatPtrParam.convert_python_to_c()" alt="" coords="101,624,557,656"/>
<area shape="rect" href="pybindgen.typehandlers.inttype.UInt16Return-class.html#convert_python_to_c" title="inttype.UInt16Return.convert_python_to_c()" alt="" coords="113,680,545,712"/>
<area shape="rect" href="pybindgen.typehandlers.inttype.UInt8Return-class.html#convert_python_to_c" title="inttype.UInt8Return.convert_python_to_c()" alt="" coords="119,736,540,768"/>
</map>
  <img src="call_graph_for_write_error_che.gif" alt='' usemap="#call_graph_for_write_error_che" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

  <p>Add a chunk of code that checks for a possible error</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>failure_expression</code></strong> - C boolean expression that is true when an error occurred</li>
        <li><strong class="pname"><code>failure_cleanup</code></strong> - optional extra cleanup code to write only for the the case when 
          failure_expression is true; this extra cleanup code comes before 
          all other cleanup code previously registered.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pybindgen-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Sun Jul 12 17:23:27 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
